Dynomotion

Group: DynoMotion Message: 2064 From: jewe gatito Date: 10/29/2011
Subject: DAC output unstable
Hello,

I'm trying to configure a 3 axis milling machine with the DAC command method but every time I restart, activate the servodrives or perform switch actions the DAC outputs are changing, especially (0-2). I first thought it was my offset configuration that was false but I retried many times and double checked with the inside drive parameter. So I also expected a drift incoming from the PID parameters within the KFLOP nor the drive. I just set everything to 0 or lowest value available and re configured step by step. When achieved, I restarted to see if configuration is reliable and the same problem occurs each time.
I use the KFLOP/Kanalog combo and it's quite difficult to figure out what I'm doing wrong.
So if anyone could help it would be greatly appreciated.

Thanks for your attention.

Regards,

Jerome
Group: DynoMotion Message: 2065 From: Tom Kerekes Date: 10/29/2011
Subject: Re: DAC output unstable
Hi Jerome,
 
I'm having a bit of trouble understanding what you are doing or expecting.  But when you are testing by entering DAC commands on the Console screen the Axis that uses that DAC must be disabled.  Otherwise the Axis channel will be continuously writing to the DAC and immediately overwrite anything you try to set them to.
 
Regards
TK

Group: DynoMotion Message: 2068 From: jewe gatito Date: 10/30/2011
Subject: Re: DAC output unstable
Hi Tom,

Thanks for your fast answer.
I checked the axis enabled issue and yes it was a problem. But now, I have retried to configure and still have a movement problem without outputting anything. The three axis are moving when I activate them through a switch that enables them directly (servo on within the drives). When I check the the rpm status within the drives this is referenced as 0, indicating that the offset is null. This situation is confirmed by the DAC voltage output that is not changing and corresponding to the initial offset value. (i.e. DAC0=-7;DAC1=-7;DAC2=-20). The voltages have been voltmeter tested and in accordance to above results.
I restarted the Kflop, I then downloaded the offset values in the Kflop (-7;-7;-20)and when I power up the drives & activate the axis via the switches (SW0, SW1) respectively they are moving.
Axis enable is not checked.
I tried to change the offset setting to see if the axis with offset changed is keeping his place and it doesn't. I re-downloaded the initial offset and re-activated the drives the axis is no more moving...
I deactivated (SW1) the drives and downloaded the initial offset values the drives are now moving with or without the drive enable under Axis window. The situation is unclear and unstable.
So I don't understand what's going on.
If you want me to let you access my config. I can give you Teamviewer access.

I will now reinitialize the drives and Kflop config and retest.

Regards,

Jerome


--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Jerome,
>  
> I'm having a bit of trouble understanding what you are doing or expecting.  But when you are testing by entering DAC commands on the Console screen the Axis that uses that DAC must be disabled.  Otherwise the Axis channel will be continuously writing to the DAC and immediately overwrite anything you try to set them to.
>  
> Regards
> TK
>
> From: jewe gatito <fouijar@...>
> To: DynoMotion@yahoogroups.com
> Sent: Saturday, October 29, 2011 6:13 PM
> Subject: [DynoMotion] DAC output unstable
>
>
>  
> Hello,
>
> I'm trying to configure a 3 axis milling machine with the DAC command method but every time I restart, activate the servodrives or perform switch actions the DAC outputs are changing, especially (0-2). I first thought it was my offset configuration that was false but I retried many times and double checked with the inside drive parameter. So I also expected a drift incoming from the PID parameters within the KFLOP nor the drive. I just set everything to 0 or lowest value available and re configured step by step. When achieved, I restarted to see if configuration is reliable and the same problem occurs each time.
> I use the KFLOP/Kanalog combo and it's quite difficult to figure out what I'm doing wrong.
> So if anyone could help it would be greatly appreciated.
>
> Thanks for your attention.
>
> Regards,
>
> Jerome
>
Group: DynoMotion Message: 2069 From: Tom Kerekes Date: 10/30/2011
Subject: Re: DAC output unstable
Hi Jerome,
 
I'm having a bit of trouble following you. Especially the part about the motors moving with the drives deactivated?  I also don't understand the values -7, -7, -20.  Are those Output Offsets that you are entering?
 
But anyways, it is normal to have some offset which will cause some slow motion with a DAC commanded to zero.  It is very difficult for an analog signal to be perfectly at zero and command zero velocity.  This will not be a problem after the servo is enabled.  The servo will then command whatever DAC value is required to hold the desired position.  To completely stop motion you should keep the amplifiers disabled.  Your Init.c program will then enable the amplifiers and then immediately enable the servo loop.
 
If you wish to reduce the offset as much as possible (but this is really not necessary) you can adjust the Output Offset values for the axis channel.  When the axis is disabled these values will then be output instead of zero.  But what may be confusing you is that this will not happen on power up as the values have not been configured for the axis.  Only after the axis is configured and the axis is disabled will the values be applied.
 
HTH
Regards
TK
 

Group: DynoMotion Message: 2070 From: jewe gatito Date: 10/30/2011
Subject: Re: DAC output unstable
Hi Tom,

I have well understood the activation process within the Init.c and the fact that the drives are enabled. When I talk about axis enabled there are two situations:
1- physically with the switch, without any c code running, this part is necessary for the drive to accept incoming commands. This is referred as Servo On: /S-ON, activated by the SW1 on Kanalog.
2- software enabled by the Axis window, and by the way this screen shows me that when I download the parameters in the Kflop corresponding axis is enabled.
The axis are not moving when not activated, they are moving even if the check box under Axis window is unchecked.

Later... I had a thought and the above line is the answer...
If I want the axis to be maintained in position the check box in Axis window as to be checked and if the error counter is equal or above max value this check box is unchecked resulting in (linear) drift.

About the DAC value, the offset I specified is good enough to obtain a 0 rpm input reference in the drive so, it's good. And yes(-7;-7;-20) are the numerical 10 bits DAC values.

Next step:

What I still don't understand is why when I move to the step response screen and ask for a move, the axis move and then the drift occurs. I can see the command as a constant value, the output too and the position starting to drift as soon as errors are present.

What do I think:
1- The drives are still keeping the previous position
2- There is no correction, regulation and errors are becoming large. Error counter is above max error, when this situation occurs the servo enabled disappear and drift comes on.

How to proceed in this situation? I mean how to disable the drives and prepare them to a step/response test when I come from other tests and have the drives enabled. I repeat, when I disable the drives in axis window they instantly start drifting fast enough to have dangerous situation before a step response can be done on one of the axis.

Should I always stop and restart everything?...

I hope I'm improving my explanations and I would like to thank you for your attention.

Regards,

Jerome


--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Jerome,
>  
> I'm having a bit of trouble following you. Especially the part about the motors moving with the drives deactivated?  I also don't understand the values -7, -7, -20.  Are those Output Offsets that you are entering?
>  
> But anyways, it is normal to have some offset which will cause some slow motion with a DAC commanded to zero.  It is very difficult for an analog signal to be perfectly at zero and command zero velocity.  This will not be a problem after the servo is enabled.  The servo will then command whatever DAC value is required to hold the desired position.  To completely stop motion you should keep the amplifiers disabled.  Your Init.c program will then enable the amplifiers and then immediately enable the servo loop.
>  
> If you wish to reduce the offset as much as possible (but this is really not necessary) you can adjust the Output Offset values for the axis channel.  When the axis is disabled these values will then be output instead of zero.  But what may be confusing you is that this will not happen on power up as the values have not been configured for the axis.  Only after the axis is configured and the axis is disabled will the values be applied.
>  
> HTH
> Regards
> TK
>  
>
> From: jewe gatito <fouijar@...>
> To: DynoMotion@yahoogroups.com
> Sent: Sunday, October 30, 2011 10:47 AM
> Subject: [DynoMotion] Re: DAC output unstable
>
>
>  
> Hi Tom,
>
> Thanks for your fast answer.
> I checked the axis enabled issue and yes it was a problem. But now, I have retried to configure and still have a movement problem without outputting anything. The three axis are moving when I activate them through a switch that enables them directly (servo on within the drives). When I check the the rpm status within the drives this is referenced as 0, indicating that the offset is null. This situation is confirmed by the DAC voltage output that is not changing and corresponding to the initial offset value. (i.e. DAC0=-7;DAC1=-7;DAC2=-20). The voltages have been voltmeter tested and in accordance to above results.
> I restarted the Kflop, I then downloaded the offset values in the Kflop (-7;-7;-20)and when I power up the drives & activate the axis via the switches (SW0, SW1) respectively they are moving.
> Axis enable is not checked.
> I tried to change the offset setting to see if the axis with offset changed is keeping his place and it doesn't. I re-downloaded the initial offset and re-activated the drives the axis is no more moving...
> I deactivated (SW1) the drives and downloaded the initial offset values the drives are now moving with or without the drive enable under Axis window. The situation is unclear and unstable.
> So I don't understand what's going on.
> If you want me to let you access my config. I can give you Teamviewer access.
>
> I will now reinitialize the drives and Kflop config and retest.
>
> Regards,
>
> Jerome
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi Jerome,
> >  
> > I'm having a bit of trouble understanding what you are doing or expecting.  But when you are testing by entering DAC commands on the Console screen the Axis that uses that DAC must be disabled.  Otherwise the Axis channel will be continuously writing to the DAC and immediately overwrite anything you try to set them to.
> >  
> > Regards
> > TK
> >
> > From: jewe gatito <fouijar@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Saturday, October 29, 2011 6:13 PM
> > Subject: [DynoMotion] DAC output unstable
> >
> >
> >  
> > Hello,
> >
> > I'm trying to configure a 3 axis milling machine with the DAC command method but every time I restart, activate the servodrives or perform switch actions the DAC outputs are changing, especially (0-2). I first thought it was my offset configuration that was false but I retried many times and double checked with the inside drive parameter. So I also expected a drift incoming from the PID parameters within the KFLOP nor the drive. I just set everything to 0 or lowest value available and re configured step by step. When achieved, I restarted to see if configuration is reliable and the same problem occurs each time.
> > I use the KFLOP/Kanalog combo and it's quite difficult to figure out what I'm doing wrong.
> > So if anyone could help it would be greatly appreciated.
> >
> > Thanks for your attention.
> >
> > Regards,
> >
> > Jerome
> >
>
Group: DynoMotion Message: 2071 From: Tom Kerekes Date: 10/30/2011
Subject: Re: DAC output unstable
Hi Jerome,
 
To avoid drift you will need to disable your amplifier whenever the servo becomes disabled.
 
There is an example program called WatchEnable.c (see below) that will watch an axis and whenever it becomes disabled it will automatically clear an output to disable your amplifier.
 
Try running that.  You can also add that watch loop into the end of your Init.c program so it will run after initializing your system.
 
You are probably correct.  On the Step Response screen your gains or something is probably not set properly so the servo is not working correctly to hold the position.  A common problem is to have the direction wrong in the configuration (OutputGain or Input0 Gain) such that the motor drives the wrong way to correct any error.  If you can't figure it out send screenshots of your screens (as *.png files) and we should be able to help.
 
Regards
TK 
 
 
#include "KMotionDef.h"
main()
{
    for (;;)  //loop forever
    {
        WaitNextTimeSlice();
        if (ch0->Enable)
            SetBit(152);
        else
            ClearBit(152);
    }
}

Group: DynoMotion Message: 2082 From: jewe gatito Date: 11/1/2011
Subject: Re: DAC output unstable
Hello Tom,

I uploaded some pictures about my setup. I also joined screen capture and My init file.
I did some tests but I'm not having good results yet.

Jerome
Group: DynoMotion Message: 2085 From: Tom Kerekes Date: 11/1/2011
Subject: Re: DAC output unstable
Hi Jerome,
 
It looks like you are probably getting close.
 
Here are some comments:
 
On Axis2
 
You have Feed forward set - remove it.
 
Your acceleration seems very high 29 million.  That would accelerate to your full speed in less than 0.01 seconds.  Reduce it.
 
Your following error is set very low - 20 counts - increase it at least for now until you get things working
 
in you Init.c program the lines:
 
    EnableAxis(3);
    DefineCoordSystem(0,1,2,3);
are after a forever loop.  They will never be executed.  Move them before the loop.
 
For Gains and Max Speeds and Accelerations use simple numbers like 2.9e6. Using 4 digits is not really necessary.
 
When the plotted errors are small either zoom in (left mouse click drag) or plot error so we can see better what is happening. 
 
Hope this helps.
 
TK
 
 
 

Group: DynoMotion Message: 2086 From: jewe gatito Date: 11/1/2011
Subject: Re: DAC output unstable
Hi Tom,

About the error counter, feed forward, I tested it and also did without, I just took the picture with.
I will reduce the acceleration, I tested the feed with the drive directly ans I have an overcurrent fault if I want 1000 rpm with hard accel, so I probably reach the response limits with associated control losses.

The drift picture is taken with the proportional parameter only.

I have the possibility to apply a S curve or smooth accel within the drive, should I or it's better to leave that for Kflop?

I will reduce the parameters tomorrow and keep you in touch.
I also have errors with mach3 config but it'll be discussed when appropriate, I mean after getting everything to work.

Regards,

Jerome

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Jerome,
>  
> It looks like you are probably getting close.
>  
> Here are some comments:
>  
> On Axis2
>  
> You have Feed forward set - remove it.
>  
> Your acceleration seems very high 29 million.  That would accelerate to your full speed in less than 0.01 seconds.  Reduce it.
>  
> Your following error is set very low - 20 counts - increase it at least for now until you get things working
>  
> in you Init.c program the lines:
>  
>     EnableAxis(3);
>     DefineCoordSystem(0,1,2,3);
>
> are after a forever loop.  They will never be executed.  Move them before the loop.
>  
> For Gains and Max Speeds and Accelerations use simple numbers like 2.9e6. Using 4 digits is not really necessary.
>  
> When the plotted errors are small either zoom in (left mouse click drag) or plot error so we can see better what is happening. 
>  
> Hope this helps.
>  
> TK
>  
>  
>  
>
> From: jewe gatito <fouijar@...>
> To: DynoMotion@yahoogroups.com
> Sent: Tuesday, November 1, 2011 5:19 PM
> Subject: [DynoMotion] Re: DAC output unstable
>
>
>  
>
> Hello Tom,
>
> I uploaded some pictures about my setup. I also joined screen capture and My init file.
> I did some tests but I'm not having good results yet.
>
> Jerome
>
Group: DynoMotion Message: 2092 From: Fouijar Date: 11/2/2011
Subject: Re: DAC output unstable
Hello,

I think I resolved the problem. This was a security issue. I found that because the command and output signals were flat. To me it was like a non-connected cable or no output problem. So I looked on the wiring side and the control side. This was a limit switch disabling the motor output signal. Anyway, thanks for your support and your time. You will find the screen capture in my folder.

Regards,

Jerome

--- In DynoMotion@yahoogroups.com, "jewe gatito" <fouijar@...> wrote:
>
> Hi Tom,
>
> About the error counter, feed forward, I tested it and also did without, I just took the picture with.
> I will reduce the acceleration, I tested the feed with the drive directly ans I have an overcurrent fault if I want 1000 rpm with hard accel, so I probably reach the response limits with associated control losses.
>
> The drift picture is taken with the proportional parameter only.
>
> I have the possibility to apply a S curve or smooth accel within the drive, should I or it's better to leave that for Kflop?
>
> I will reduce the parameters tomorrow and keep you in touch.
> I also have errors with mach3 config but it'll be discussed when appropriate, I mean after getting everything to work.
>
> Regards,
>
> Jerome
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi Jerome,
> >  
> > It looks like you are probably getting close.
> >  
> > Here are some comments:
> >  
> > On Axis2
> >  
> > You have Feed forward set - remove it.
> >  
> > Your acceleration seems very high 29 million.  That would accelerate to your full speed in less than 0.01 seconds.  Reduce it.
> >  
> > Your following error is set very low - 20 counts - increase it at least for now until you get things working
> >  
> > in you Init.c program the lines:
> >  
> >     EnableAxis(3);
> >     DefineCoordSystem(0,1,2,3);
> >
> > are after a forever loop.  They will never be executed.  Move them before the loop.
> >  
> > For Gains and Max Speeds and Accelerations use simple numbers like 2.9e6. Using 4 digits is not really necessary.
> >  
> > When the plotted errors are small either zoom in (left mouse click drag) or plot error so we can see better what is happening. 
> >  
> > Hope this helps.
> >  
> > TK
> >  
> >  
> >  
> >
> > From: jewe gatito <fouijar@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Tuesday, November 1, 2011 5:19 PM
> > Subject: [DynoMotion] Re: DAC output unstable
> >
> >
> >  
> >
> > Hello Tom,
> >
> > I uploaded some pictures about my setup. I also joined screen capture and My init file.
> > I did some tests but I'm not having good results yet.
> >
> > Jerome
> >
>
Group: DynoMotion Message: 2094 From: Tom Kerekes Date: 11/2/2011
Subject: Re: DAC output unstable
Hi Jerome,
 
That looks very impressive!  A complete move of 10,000 counts (whatever that is) in about 100ms.
 
If you were to zoom in or plot the error is would be possible to see better how well it is doing.
 
I did notice that you have a Max Error Setting of only 10.  This is quite small.  This forces any errors greater than 10 to be treated as if the error was only 10.  Again on your plots it isn't possible to see what the size of errors really are.  But normally the Max error should be set to a bit larger than what the errors really are.  This helps the abnormal case when somehow a very large error occurs such as something pushing the axis way off target.  The servo will not react so severely as t would otherwise.
 
Regards
TK
 

Group: DynoMotion Message: 2104 From: Fouijar Date: 11/3/2011
Subject: Re: DAC output unstable
Hi Tom,

Thanks but this is only possible because of your (huge) previous work.
The resolution is 2000 counts/mm, one turn is 5mmm=> 10000 counts.
I will update the screen shots and give detailed view of the response.
But indeed, the error is usually between 3 to 6 counts, sometimes less. I have to say that this is not actually to be considered as "stable", I still have errors large enough to disable the drives. This overcomes when little growl occurs and a step response test is generated. Maybe the velocity loop gain is too high for existing parameters. I still have to handle that with the associated reduced performance.

I don't know if you have read the following book:

"Industrial servo control systems; Fundamentals and applications",Author: George W. Younkin, Editor: Marcel Dekker

Nicely made and instructive, I recommend it.
This book is useful but some principles exposed are clearly too complicated to be understood with the few explanations. But, for the Kmotion/Kflop there are many ideas to take about regualtion methods and principles... Take five minutes to see on Amazon or by the editor's website.

Regards,

Jerome



--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Jerome,
>  
> That looks very impressive!  A complete move of 10,000 counts (whatever that is) in about 100ms.
>  
> If you were to zoom in or plot the error is would be possible to see better how well it is doing.
>  
> I did notice that you have a Max Error Setting of only 10.  This is quite small.  This forces any errors greater than 10 to be treated as if the error was only 10.  Again on your plots it isn't possible to see what the size of errors really are.  But normally the Max error should be set to a bit larger than what the errors really are.  This helps the abnormal case when somehow a very large error occurs such as something pushing the axis way off target.  The servo will not react so severely as t would otherwise.
>  
> Regards
> TK
>  
>
>
> ________________________________
> From: Fouijar <fouijar@...>
> To: DynoMotion@yahoogroups.com
> Sent: Wednesday, November 2, 2011 11:26 AM
> Subject: [DynoMotion] Re: DAC output unstable
>
>
>  
> Hello,
>
> I think I resolved the problem. This was a security issue. I found that because the command and output signals were flat. To me it was like a non-connected cable or no output problem. So I looked on the wiring side and the control side. This was a limit switch disabling the motor output signal. Anyway, thanks for your support and your time. You will find the screen capture in my folder.
>
> Regards,
>
> Jerome
>
> --- In DynoMotion@yahoogroups.com, "jewe gatito" <fouijar@> wrote:
> >
> > Hi Tom,
> >
> > About the error counter, feed forward, I tested it and also did without, I just took the picture with.
> > I will reduce the acceleration, I tested the feed with the drive directly ans I have an overcurrent fault if I want 1000 rpm with hard accel, so I probably reach the response limits with associated control losses.
> >
> > The drift picture is taken with the proportional parameter only.
> >
> > I have the possibility to apply a S curve or smooth accel within the drive, should I or it's better to leave that for Kflop?
> >
> > I will reduce the parameters tomorrow and keep you in touch.
> > I also have errors with mach3 config but it'll be discussed when appropriate, I mean after getting everything to work.
> >
> > Regards,
> >
> > Jerome
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > > Hi Jerome,
> > >  
> > > It looks like you are probably getting close.
> > >  
> > > Here are some comments:
> > >  
> > > On Axis2
> > >  
> > > You have Feed forward set - remove it.
> > >  
> > > Your acceleration seems very high 29 million.  That would accelerate to your full speed in less than 0.01 seconds.  Reduce it.
> > >  
> > > Your following error is set very low - 20 counts - increase it at least for now until you get things working
> > >  
> > > in you Init.c program the lines:
> > >  
> > >     EnableAxis(3);
> > >     DefineCoordSystem(0,1,2,3);
> > >
> > > are after a forever loop.  They will never be executed.  Move them before the loop.
> > >  
> > > For Gains and Max Speeds and Accelerations use simple numbers like 2.9e6. Using 4 digits is not really necessary.
> > >  
> > > When the plotted errors are small either zoom in (left mouse click drag) or plot error so we can see better what is happening. 
> > >  
> > > Hope this helps.
> > >  
> > > TK
> > >  
> > >  
> > >  
> > >
> > > From: jewe gatito <fouijar@>
> > > To: DynoMotion@yahoogroups.com
> > > Sent: Tuesday, November 1, 2011 5:19 PM
> > > Subject: [DynoMotion] Re: DAC output unstable
> > >
> > >
> > >  
> > >
> > > Hello Tom,
> > >
> > > I uploaded some pictures about my setup. I also joined screen capture and My init file.
> > > I did some tests but I'm not having good results yet.
> > >
> > > Jerome
> > >
> >
>
Group: DynoMotion Message: 2106 From: Tom Kerekes Date: 11/3/2011
Subject: Re: DAC output unstable
Hi Jerome,
 
That book looks familiar and like a classic.
 
Here is a link for one of the best books to explain the underlying math in a fairly readable form.  And its free on-line.
 
 
Regards
TK